﻿using Microsoft.Xna.Framework.Content;
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace BeatingMole
{
    class CGuiLoadingGame : Game
    {
        #region "Variable"
        ContentManager _content;
        SpriteBatch _spriteBatch;
        GameTime _gameTime;
        bool IsEnable = true;
        #endregion

        #region "Properties"
        public bool IsEnableGui
        {
            set { IsEnable = value; }
            get { return IsEnable; }
        }
        #endregion

        #region "Bus"
        CBusLoadingGame BusLoadingGame;
        #endregion

        #region "Constructor"
        public CGuiLoadingGame(ContentManager content, SpriteBatch spriteBatch, GameTime gameTime)
        {
            _content = content;
            _spriteBatch = spriteBatch;
            _gameTime = gameTime;

            BusLoadingGame = new CBusLoadingGame(_content, _spriteBatch, _gameTime);

        }
        #endregion

        #region "Method"
        /// <summary>
        /// Phương thức cập nhật của Map
        /// </summary>
        /// <param name="gameTime"></param>
        public void UpdateMap(GameTime gameTime)
        {
            if (IsEnableGui == true)
            {
                BusLoadingGame.UpdateLoadingGame(gameTime);
            }
        }


        public void ResumeGame(GameTime gameTime)
        {
            BusLoadingGame.ResumeGame(gameTime);
        }
        /// <summary>
        /// Phương thức Draw của Map
        /// </summary>
        /// <param name="spriteBatch"></param>
        public void Draw(SpriteBatch spriteBatch)
        {
            if (IsEnableGui == true)
            {
                BusLoadingGame.DrawLoadingGame(spriteBatch);
            }
        }
        #endregion
    }
}
